import { Draw } from "../Draw/Draw";

/**
 * 框选实现
 */
export class FrameSelect {
  constructor(draw: Draw) {
    const selectedBox = document.createElement("div");
    selectedBox.className = "konva-root-container-frame_selected";

    // 同时为了定位准确，还需要直接将 selectedBox 添加到 konva 容器中
    const rootBox = draw.getRootBox();
    const konvaSelector = ".konvajs-content";
    const konvaBoxParent = <HTMLDivElement>rootBox.querySelector(konvaSelector);

    konvaBoxParent.appendChild(selectedBox);
  }
}
